/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Jhon
 */
@Entity
@Table(name = "txtype", catalog = "taller", schema = "")
@NamedQueries({
    @NamedQuery(name = "Txtype.findAll", query = "SELECT t FROM Txtype t"),
    @NamedQuery(name = "Txtype.findByIdTxType", query = "SELECT t FROM Txtype t WHERE t.idTxType = :idTxType"),
    @NamedQuery(name = "Txtype.findByName", query = "SELECT t FROM Txtype t WHERE t.name = :name")})
public class Txtype implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idTxType", nullable = false)
    private Integer idTxType;
    @Basic(optional = false)
    @Column(name = "name", nullable = false, length = 255)
    private String name;
    @Lob
    @Column(name = "description", length = 65535)
    private String description;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "txtype")
    private List<Banktx> banktxList;

    public Txtype() {
    }

    public Txtype(Integer idTxType) {
        this.idTxType = idTxType;
    }

    public Txtype(Integer idTxType, String name) {
        this.idTxType = idTxType;
        this.name = name;
    }

    public Integer getIdTxType() {
        return idTxType;
    }

    public void setIdTxType(Integer idTxType) {
        this.idTxType = idTxType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<Banktx> getBanktxList() {
        return banktxList;
    }

    public void setBanktxList(List<Banktx> banktxList) {
        this.banktxList = banktxList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTxType != null ? idTxType.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Txtype)) {
            return false;
        }
        Txtype other = (Txtype) object;
        if ((this.idTxType == null && other.idTxType != null) || (this.idTxType != null && !this.idTxType.equals(other.idTxType))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Txtype[idTxType=" + idTxType + "]";
    }

}
